<template>
	<view>
				
		<!-- 个人中心页面 -->
		<view class="u-m-t-20 personalInfo">
			<u-cell-group>
				<u-cell icon="setting" title="个人信息" @click="toPersonInfo"></u-cell>
			</u-cell-group>
		</view>
		
		<view class="u-m-t-20 functionBar">
			<u-cell-group>
				<u-cell icon="moments" title="我的帖子" @click="toOrder"></u-cell>
				<u-cell icon="thumb-up-fill" title="我的点赞" @click="toLike"></u-cell>
				<u-cell icon="more-circle-fill" title="我的评论" @click="toComment"></u-cell>
			</u-cell-group>
		</view>
		
		<view class="u-m-t-20 aboutapp">
			<u-cell-group>
				<u-cell icon="grid-fill" title="关于我们" @click="toOur"></u-cell>
				<u-cell icon="file-text-fill" title="用户协议" @click="toUserProtocol"></u-cell>
				<u-cell icon="email-fill" title="意见反馈" @click="toAddress"></u-cell>
			</u-cell-group>
		</view>
		
		<view class="u-m-t-20 logout">
			<u-cell-group>
				<u-cell icon="reload" title="退出登录" @click="logout"></u-cell>
			</u-cell-group>
		</view>
		
		
		
		
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				// 头像链接
				src: 'https://uviewui.com/common/logo.png',
				// 用户信息
				user: {
					"name": "test",
					"email": "asdf@qq.com"
				}
			}
		},
		// 下面放方法
		methods: {
			// 跳转到个人信息
			toPersonInfo(){
				this.$u.route({
					type:'navigateTo',
					url: `pages/center/personInfo`,
					params: {
						name: this.user.name,
						email: this.user.email,
					}
				})
			},
			
			// 跳转到订单列表
			toOrder(){
				this.$u.route({
					url: `pages/center/order`
				})
			},
			// 跳转到我的点赞
			toLike(){
				this.$u.route({
					url: `pages/center/like`
				})
			},
			
			// 跳转到评论
			toComment(){
				this.$u.route({
					url: `pages/center/comments`
				})
			},

			// 关于我们
			toOur(){
				this.$u.route({
					url: `pages/center/aboutus`
				})
			},

			// 用户协议
			toUserProtocol(){
				this.$u.route({
					url: `pages/center/userprotocol`
				})
			},

			// 意见反馈
			toAddress(){
				this.$u.route({
					url: `pages/center/suggestion`
				})
			},

			// 退出登陆的方法
			logout(){
				console.log("退出登陆");
				this.$u.route({
					url: 'pages/auth/login'
				})
			},
		}
}
</script>
	

<style lang="scss">
page{
	background-color: #ededed;
}

.user-box{
	background-color: #fff;
	padding: 10rpx 0;
	
}

.personalInfo{
	background-color: #fff;
}

.functionBar{
	background-color: #fff;
	margin: 15rpx 0;
}

.aboutapp{
	background-color: #fff;
	margin: 15rpx 0;
}

.logout{
	background-color: #fff;
}

</style>

